<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/common/utils.js"></script>
<script src="./resources/common.js"></script>
<script src="./resources/dispatcher.js"></script>
<script src="./resources/iframeTest.js"></script>

<script>

const parent_coep_credentialless = newWindow(coep_credentialless);
iframeTest("COEP:credentialless embeds same-origin COEP:none",
  parent_coep_credentialless, same_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds cross-origin COEP:none",
  parent_coep_credentialless, cross_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds same-origin COEP:credentialless",
  parent_coep_credentialless, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTest("COEP:credentialless embeds cross-origin COEP:credentialless",
  parent_coep_credentialless, cross_origin, coep_credentialless, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds same-origin COEP:require-corp",
  parent_coep_credentialless, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTest("COEP:credentialless embeds cross-origin COEP:require-corp",
  parent_coep_credentialless, cross_origin, coep_require_corp, EXPECT_BLOCK);

// Using CORP:cross-origin might unblock previously blocked iframes.
iframeTestCORP("COEP:credentialless embeds same-origin COEP:none",
  parent_coep_credentialless, same_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:none",
  parent_coep_credentialless, cross_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:credentialless embeds same-origin COEP:credentialless",
  parent_coep_credentialless, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:credentialless",
  parent_coep_credentialless, cross_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds same-origin COEP:require-corp",
  parent_coep_credentialless, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:require-corp",
  parent_coep_credentialless, cross_origin, coep_require_corp, EXPECT_LOAD);

</script>
